import { Devcloud } from "../apiClass"
import { IResult } from "../../plugins/Interfaces"


export class EnumApi extends Devcloud {
  private baseUrl: string = this.path + 'enum/';
  async getValueDesc(str:string): Promise<IResult> {
    const resp = await this.client.get(this.baseUrl + "valueDesc/get", {"enum": str})
    return resp.data
  }
  async listValueDesc(str:string): Promise<IResult> {
    const resp = await this.client.get(this.baseUrl + "valueDesc/list", {"enums": str})
    return resp.data
  }
  async getCodeDesc(str:string): Promise<IResult> {
    const resp = await this.client.get(this.baseUrl + "codeDesc/get", {"enum": str})
    return resp.data
  }
  async listCodeDesc(str:string): Promise<IResult> {
    const resp = await this.client.get(this.baseUrl + "codeDesc/list", {"enums": str})
    return resp.data
  }
  async getCode(str:string): Promise<IResult> {
    const resp = await this.client.get(this.baseUrl + "code/get", {"enum": str})
    return resp.data
  }
  async listCode(str:string): Promise<IResult> {
    const resp = await this.client.get(this.baseUrl + "code/list", {"enums": str})
    return resp.data
  }
}